<#list m.classes as c>

    drop table ${c.table!""} if exists;
    
    create table ${c.table!""} (
        ID bigint not null,
        <#list c.oneToOne as o>
        <#if o.inverse == "false">
        ${o.column} bigint not null unique,
        </#if>
        </#list>
        <#list c.manyToOne as mo>
        ${mo.column} bigint not null,
        </#list>
        <#list c.properties as p>
        ${p.column}<#if p.type == "String"> varchar(${p.length})<#elseif p.type == "Long"> bigint<#elseif p.type == "Date"> timestamp</#if><#if p.notNull == "true"> not null</#if><#if p.unique == "true"> unique</#if>,
        </#list>
        
        STATUS varchar(1) not null,
        CREATED_USER bigint not null,
        CREATED_DATE timestamp not null,
        UPDATED_USER bigint,
        UPDATED_DATE timestamp,
        primary key (ID)
    );
    
    drop sequence SEQ_${c.table!""} if exists;
    
    create sequence SEQ_${c.table!""};
</#list>